package com.basic.shiro.factroy;

import java.util.LinkedHashMap;

public class FilterChainDefinitionMapBuilder {
    public LinkedHashMap<String, String> buildFilterChainDefinitionMap() {
        LinkedHashMap<String, String> map = new LinkedHashMap<>();
        /*访问数据库 转为map 且前后顺序为匹配顺序*/


        map.put("/login.jsp", "anon");
        map.put("/shiro/login", "anon");
        map.put("/shiro/logout", "logout");
        map.put("/user.jsp", "roles[user],authc");
        map.put("/admin.jsp", "roles[admin],authc");
        map.put("/list.jsp", "user");


        /*------------------------------------------------------*/
        map.put("/**", "authc");
        return map;
    }
}
